package com.ck.ips.model.vo;

import com.ck.core.util.DateUtils;

/**
 * @description: 增播减播详情
 * @author: zhanglei
 * @date: 2019/5/13 10:28
 */
public class ProgramAddSubFailedVO {
    /**
     * 终端组
     */
    private String deviceGroupName;

    /**
     * 终端唯一编码
     */
    private String deviceCode;

    /**
     * 终端序列号
     */
    private String deviceSerialNum;

    /**
     * 终端mac
     */
    private String deviceMac;

    /**
     * 操作说明
     */
    private String operation;

    /**
     * 增播减播时间
     */
    private Long addTime;

    /**
     * 增播失败时间
     */
    private Long cpalAddTime;

    /**
     * 减播失败时间
     */
    private Long cprlAddTime;

    /**
     * 节目名称
     */
    private String programName;

    /**
     * 素材名称
     */
    private String fileName;

    /**
     * 失败类型 1-为下载 3-处理失败
     */
    private Integer downloadStatus;

    public String getDeviceGroupName() {
        return deviceGroupName;
    }

    public void setDeviceGroupName(String deviceGroupName) {
        this.deviceGroupName = deviceGroupName;
    }

    public String getDeviceCode() {
        return deviceCode;
    }

    public void setDeviceCode(String deviceCode) {
        this.deviceCode = deviceCode;
    }

    public String getDeviceMac() {
        return deviceMac;
    }

    public void setDeviceMac(String deviceMac) {
        this.deviceMac = deviceMac;
    }

    public String getOperation() {
        if(this.operation!=null){
            return this.operation;
        }
        this.addTime = this.cpalAddTime==null?this.cprlAddTime:this.cpalAddTime;
        String dateStr = DateUtils.longTimeStampToStringDate(this.addTime,"yyyy-MM-dd HH:mm:ss");
        this.operation = dateStr;
        if(fileName==null){
            this.operation+=" 增播任务,'"+programName+"',";
        }else{
            this.operation+=" 减播任务,'"+fileName+"',";
        }
        if(downloadStatus==0){
            this.operation+="下发失败";
        }else {
            this.operation+="执行失败";
        }
        return this.operation;
    }

    public void setOperation(String operation) {
        this.operation = operation;
    }

    public Long getAddTime() {
        return this.cpalAddTime==null?this.cprlAddTime:this.cpalAddTime;
    }

    public void setAddTime(Long addTime) {
        this.addTime = addTime;
    }

    public String getProgramName() {
        return programName;
    }

    public void setProgramName(String programName) {
        this.programName = programName;
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public Integer getDownloadStatus() {
        return downloadStatus;
    }

    public void setDownloadStatus(Integer downloadStatus) {
        this.downloadStatus = downloadStatus;
    }

    public String getDeviceSerialNum() {
        return deviceSerialNum;
    }

    public void setDeviceSerialNum(String deviceSerialNum) {
        this.deviceSerialNum = deviceSerialNum;
    }

    public Long getCpalAddTime() {
        return cpalAddTime;
    }

    public void setCpalAddTime(Long cpalAddTime) {
        this.cpalAddTime = cpalAddTime;
    }

    public Long getCprlAddTime() {
        return cprlAddTime;
    }

    public void setCprlAddTime(Long cprlAddTime) {
        this.cprlAddTime = cprlAddTime;
    }
}
